home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-serious-
/
virus
/
virus_checkerii
/
arexx
/
virus.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-07-12
|
2KB
|
98 lines
/* Virus checker AREXX script for periodical invocation */
if ~show('l','rexxreqtools.library') then
call addlib('rexxreqtools.library',0,-30,0)
if ~show('l','rexxsupport.library') then
call addlib('rexxsupport.library',0,-30,0)
NL = '0a'x
listing = showdir('Q:',"F") /* look for files in Q: */
if listing = "" then
exit /* exit if none */
else
/* make sure that the dup directory is empty first! */
listing = showdir('DL:dup',"F")
if listing ~= "" then
do
address command
'playsound sfx:voice/attention.ssmp quiet'
call rtezrequest( " WARNING!" || NL ||,
" ~~~~~~~~" || NL ||,
"Dup directory is not" || NL ||,
"Empty! Unable to scan files!", "EXIT")
exit
end
else
call rtezrequest('Scan files now?','Yes|No')
select
when rtresult=1 then
signal scan
otherwise
exit
scan:
/* if ~exists(Virus_Checker) */
address 'Virus_CheckerII' 'scan dh1:quarantine'
/* Q: dir checker to check for*/
/* any virri in the new files */
/* and move them to DL: */
err = 0
r = 0
/* command to check directories and compare files */
options results
address command
'dh0:progs/ls -mCIf Q: >t:vc1'
call open('the_file','t:vc1','R')
do until EOF('the_file')
j = readln('the_file')
if j = '' then
signal done
else
/* say "moving file "||j */
r = exists('dl:'||j) /* r=1 then we have the file already existing */
if r = 1 then
do
address command
'move q:'|| j ||' to dl:dup/'||j
err = err + 1
ef.err = j
/* incriment error counter for later use */
end
else
do
/* just move the file normally */
address command
'move q:'|| j || ' DL: clone'
/* say "all ok" */
end
end
done:
call close('the_file')
address command
'rm t:vc1 quiet'
say 'Finished...'
if err ~= 0 then
do
/* say err || ' file/s already existing.' */
address command
'playsound sfx:voice/attention.ssmp quiet'
call rtezrequest( " WARNING!" || NL ||,
" ~~~~~~~~" || NL ||,
err || " files were put in the DL:DUP directory" || NL ||,
"because there a file of the same name/s already" || NL ||,
"exsisted in DL: Please attend to ASAP!", "EXIT")
end
/* */